Skip to content

DashR Ocean Optics#240

Merged
rpkyle merged 11 commits intomasterfrom
dashr-ocean-optics
Aug 8, 2019
Merged

DashR Ocean Optics#240
rpkyle merged 11 commits intomasterfrom
dashr-ocean-optics

Conversation

@CanerIrfanoglu
Copy link
Copy Markdown
Contributor

@CanerIrfanoglu CanerIrfanoglu commented Jul 19, 2019

App pull request

  • This is a new app
  • I am improving an existing app (redesigns/code "makeovers")

About

Workflow

  • I have created a branch in the appropriate monorepo, and the
    elements necessary for successful deployment are in place.
  • If the app is a redesigned and/or restyled version of an
    existing gallery app, I've summarized the changes requested in the
    appropriate Streambed issue and confirm that they have been applied.
  • If the app is on the Dash Gallery portal, I have added a link to
    the GitHub repository for the source code in the portal description.
  • If the app is a reimplementation of a Python gallery app for the
    DashR gallery, the app in this PR mimics, as closely as possible,
    the style and functionality of the existing app.=
  • I have removed all Google Analytics code from the app's
    assets/ folder.

The pre-review review

I have addressed all of the following questions:

  • Does everything in my code serve some purpose? (I have removed
    any dead and/or irrelevant code.)
  • Does everything in my code have a clear purpose? (My code is
    readable and, where it isn't, it has been commented appropriately.)]
  • Am I reinventing the wheel? (I have used appropriate packages to
    lessen the volume of code that needs to be maintained.)

SampleSpectrum generates data for intensity values. Previously, it was lagging when 5000 points generated every second. Vectorizing SampleSpectrum to generate all 5000 points in single batch imroved performance considerably.
@rpkyle rpkyle changed the title Dashr ocean optics DashR Ocean Optics Jul 22, 2019
@rpkyle rpkyle self-requested a review July 22, 2019 22:37
@rpkyle rpkyle assigned CanerIrfanoglu and unassigned rpkyle Jul 22, 2019
Copy link
Copy Markdown
Contributor

@rpkyle rpkyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CanerIrfanoglu Looks good so far, a few minor edits requested before we merge this one. Thanks for taking this on! Let me know if you have any questions or want to discuss.

Comment thread apps/dashr-ocean-optics/app.R Outdated
Comment thread apps/dashr-ocean-optics/app.R Outdated
Comment thread apps/dashr-ocean-optics/app.R Outdated
Comment thread apps/dashr-ocean-optics/app.R Outdated
Comment thread apps/dashr-ocean-optics/app.R Outdated
),

function(pwr, ls) {
return(!(pwr && ls != "NULL" && ls != ""))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this logical expression evaluate as intended? I might be missing something, but generally in R we test for NULL by using something like is.null(foo), since NULL is a special object rather than a character string.

I would also rename ls, since this is a base R function.

It's unfortunate that c in R is also a function, since it looks like a variable name in most other languages 🙁

Copy link
Copy Markdown
Contributor Author

@CanerIrfanoglu CanerIrfanoglu Jul 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to:

  function(pwr, lsi) {
    return(!(pwr && !is.null(lsi[[1]]) && lsi != ""))
  }
)

Since lsi is type list when the dccDropdown is empty and character otherwise, had to change lsi to lsi[[1]] to ensure capturing boolean value in empty scenario.

Comment thread apps/dashr-ocean-optics/app.R Outdated
Comment thread apps/dashr-ocean-optics/app.R Outdated
Comment thread apps/dashr-ocean-optics/app.R Outdated
Comment thread apps/dashr-ocean-optics/app.R Outdated
Comment thread apps/dashr-ocean-optics/init.R
@CanerIrfanoglu CanerIrfanoglu requested a review from rpkyle July 23, 2019 19:11
@rpkyle rpkyle added the dash-r Dash R applications label Jul 30, 2019
@CanerIrfanoglu
Copy link
Copy Markdown
Contributor Author

@rpkyle thanks for the review. I applied all the changes suggested previously in b6d5b9e.

rpkyle
rpkyle previously approved these changes Aug 8, 2019
Copy link
Copy Markdown
Contributor

@rpkyle rpkyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I think it's ready to go, except for one last detail: please replace the logo with the current one (which I think you're already using in the IV tracer app) 🙂 Thanks, and nice work! 💃

@rpkyle rpkyle requested a review from sacul-git August 8, 2019 20:34
sacul-git
sacul-git previously approved these changes Aug 8, 2019
Copy link
Copy Markdown
Contributor

@sacul-git sacul-git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃 Looks good! Didn't find much to improve on :)

}

# colors for layout and figure
colorsRaw <- read.table("colors.txt", sep = ' ', comment.char = '',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not an important comment, but just out of curiosity, is there a reason to store the color data in a separate file? Why not just use a list like:

colors <- list(
  background = "#bbbbbb",
  primary = "#ffffff",
  secondary = "#efefef",
  tertiary = "#dfdfdf",
  grid-colour = "#eeeeee",
  accent = "#2222ff"
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Python version was using a separate colors.txt, I did it the same way. Also, I wouldn't mind defining it as a list in app.R :)

@CanerIrfanoglu CanerIrfanoglu dismissed stale reviews from sacul-git and rpkyle via 737032c August 8, 2019 21:49
@rpkyle rpkyle merged commit 4fe7ad5 into master Aug 8, 2019
@rpkyle rpkyle deleted the dashr-ocean-optics branch August 8, 2019 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dash-r Dash R applications

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants